export default {
  mounted(el, binding, vnode) {
    // 监听键盘事件
    el.addEventListener('keydown', (event) => {
      if (event.key === 'Enter' && event.keyCode === 13) {
        if (typeof binding.value === 'function') {
          binding.value()
        }
      }
    })
  },
  unmounted(el) {
    el.removeEventListener('keydown', () => {})
  }
}
